//银行账户类
class Account1
{
    private String name;
    private String no;
    private long balance;

    //构造函数
    Account1(String n,String num,long z)
    {
       name=n;
       no=num;
        balance=z;
    }



    //确认账户名
    String getName(){
        return name;
    }

    //确认账号
    String getNo(){
        return no;
    }

    //确认可用余额
    Long  getBalance(){
        return balance;
    }

    //存入K日元
    void deposit(long k){
        balance +=k;
    }
    //取出K日元
    void withdraw(long k){
        balance -=k;
    }

}





public class AccountTester1 {
    public static void main(String[] args) {
        //小明的账户
        Account1 adachi = new Account1("小明", "123456", 1000);
        //小红的账户
        Account1 nakata = new Account1("小红", "165432", 1000);

        adachi.withdraw(200);//小明取了200
        nakata.deposit(100);//小红取了100

        System.out.println("小明的账户：");
        System.out.println("账户名："+adachi.getName());
        System.out.println("账号："+adachi.getNo());
        System.out.println("可用余额："+adachi.getBalance());

        System.out.println();

        System.out.println("小红的账户：");
        System.out.println("账户名："+nakata.getName());
        System.out.println("账号："+nakata.getNo());
        System.out.println("可用余额："+nakata.getBalance());


    }

}
